package com.activiti.spring.controller;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ParallelGatewayController {
	@Autowired
	private RepositoryService repositoryService;
	@Autowired
	private RuntimeService runtimeService;
	@Autowired
	private TaskService taskService;
	
	@GetMapping("getDeployParallelGateway")
	@ResponseBody
	public Deployment getDeployParallelGateway() {
		Deployment deploy = repositoryService.createDeployment().name("购物流程")
				.addClasspathResource("diagrams/ParallelGateway.bpmn").deploy();
		System.out.println("部署id:" + deploy.getId());
		System.out.println("部署名称：" + deploy.getName());
		return deploy;
	}
}
